<template>
	<view class="content">

		<customNavbar :title="$t('sidebar.wallet')" @toTime="toTime" />
		<view class="user">
			<img src="../../static/img/user.png">
			<text>{{walletAddress.substring(0,4)}}****{{walletAddress.substr(-4)}}</text>
		</view>
		<view class="money">
			${{money}}
		</view>
		<view class="catgary">
			<view class="cat_item" @click="toDetail('Charge')">
				<view class="img">
					<img src="../../static/img/Charge.png" alt="">
				</view>
				<view>{{$t('wallet.Charge')}}</view>
			</view>
			<view class="cat_item" @click="toDetail('embody')">
				<view class="img">
					<img src="../../static/img/embody.png" alt="">
				</view>
				<view>{{$t('wallet.embody')}}</view>
			</view>
			<view class="cat_item" @click="toDetail('exchange')">
				<view class="img">
					<img src="../../static/img/exchange.png" alt="">
				</view>
				<view>{{$t('wallet.exchange')}}</view>
			</view>
			<view class="cat_item" @click="toDetail('Transfer')">
				<view class="img">
					<img src="../../static/img/Transfer.png" alt="">
				</view>
				<view>{{$t('wallet.Transfer')}}</view>
			</view>
			<view class="cat_item" @click="toDetail('sign')">
				<view class="img">
					<img src="../../static/img/sign.png" alt="">
				</view>
				<view>{{$t('first.qiandao')}}</view>
			</view>
		</view>
		
		
		<view class="notice">
			<u-notice-bar :text="notice2" @click="showmore()"></u-notice-bar>
		</view>
		<u-popup :show="noticeshowmore" mode="center" :closeable="true" @close="noticeshowmore = false" :round="20">
			<view class="noticepopup">
				<view style="margin-bottom: 20rpx;">{{$t('first.title139')}}</view>
				<view v-html="notice"></view>
			</view>
		</u-popup>
		<view class="baiping" v-if="falses">
			<u-popup :show="falses" mode="center" :closeable="false" @close="falses = false" :round="20">
				<view class="noticepopup">
					<view>{{falsesmsg}}</view>
					<!-- <view class="baipingbtn" @click="falses = false">{{$t('first.title140')}}</view> -->
				</view>
			</u-popup>
		</view>
		<view class="balance">
			<view class="balance_cat">
				<view @click="selectCat(1)">
					{{$t('wallet.Crypto')}}
					<view class="gang" v-if="catNum == 1"></view>
				</view>
				<view @click="selectCat(2)">
					{{$t('wallet.Profit')}}
					<view class="gang" v-if="catNum == 2"></view>
				</view>
			</view>
			<view class="balance_list">
				<view class="list_item" v-for="(item,index) in list" :key="index" @click="goindexdetail(item.id)">
					<view class="flex">
						<img :src="baseurl + item.logo" alt="">
						<view class="item_name" v-if="catNum == 1">{{item.code}}</view>
						<view class="item_name" v-if="catNum == 2 && item.code != 'DKC'">{{item.code}}D</view>
						<view class="item_name" v-if="catNum == 2 && item.code == 'DKC'">{{item.code}}</view>
					</view>
					<view class="item_price">
						<view class="" style="text-align: right;font-size:34rpx;">{{item.balance}}</view>
						<view class="" style="text-align: right;color:#666">${{item.usdt_balance}}</view>
					</view>
				</view>
			</view>
		</view>
		<!-- <view class="qiun-charts">
			<qiun-data-charts type="candle" :opts="opts" :chartData="chartData" :disableScroll="true" :ontouch="true"
				:onzoom="true" />
		</view> -->
		<view style="background-color: #fff;padding: 10rpx 30rpx;font-weight: 600;font-size: 30rpx;">
				BIC {{$t('first.jiage')}}
		</view>
		<view class="charts-box">
		    <qiun-data-charts  
		      type="candle"
		      :opts="opts"
		      :chartData="chartData"
		      :disableScroll="true"
		      :ontouch="true"
		      :onzoom="true"
		    />
		  </view>
		<view class="iframe1">
			<iframe :src="baseurl+'/api/klinelist?lang='+$i18n.locale" frameborder="0"></iframe>
			<view class="iframezzc">
				<view class="iframezzcitem" v-for="item in 7" @click="iframeclick(item)"></view>
			</view>
		</view>
		<view class="_seckillsddTitle">
			<p>{{$t('first.title138')}}</p>
			<image src="../../static/img/more.png" mode=""></image>
		</view>
		<view class="_seckill">
			<scroll-view scroll-x="true" class="_seckillBox">
				<view class="_seckill_item" v-for="(item,index) in newAlllist" :key="index"
					@click="getNewDetalis(item.id)">
					<view class="_seckill_item_img">
						<!-- <image src="../../static/img/1.png" mode="" ></image> -->
						<image :src="item.banner" mode=""></image>
					</view>
					<view class="dfsdf">
						<view class="_seckill_title">{{item.title}}</view>
					</view>
				</view>
			</scroll-view>
		</view>

		<view class="indexbottom">
			<view class="ibtop">
				<img src="../../static/img/b1.png" alt="" />
				<img src="../../static/img/b2.png" alt="" />
				<img src="../../static/img/b3.png" alt="" />
				<img src="../../static/img/b4.png" alt="" />
				<img src="../../static/img/b5.png" alt="" />
				<img src="../../static/img/b6.png" alt="" />
			</view>
			<view class="ibcon">
				<view class="ibcons">
					<img src="../../static/img/7.png" alt="" />
					<view class="texg">element</view>
				</view>
				<view class="texg1">The Frist Community-drive Aggregated Marketplace</view>
				<view class="texg2">
					<img @click="opens('https://www.facebook.com/Biworld.appcom/')" src="../../static/img/facebook.png" alt="" />
					<img @click="opens('https://t.me/biworldco')" src="../../static/img/telegram.png" alt="" />
					<img @click="opens2" style="width: 60rpx;" src="../../static/img/youxiang.png" alt="" />
					<img @click="opens('https://whatsapp.com/channel/0029VaTpZ7WE50UeCg9wGi1F')" src="../../static/img/whatsapp.png" alt="" />
					<!-- <img @click="opens" style="width: 60rpx;" src="../../static/img/tuite.png" alt="" /> -->
				</view>
				<view class="texg3">
					<view class="ibitems">{{$t('first.title141')}}</view>
					<view class="ibitems">{{$t('first.title142')}}</view>
					<view class="ibitems">{{$t('first.title143')}}</view>
					<view class="ibitems">{{$t('first.title144')}}</view>
					<view class="ibitems">API</view>
					<view class="ibitems">{{$t('first.title145')}}</view>
					<view class="ibitems">{{$t('first.title146')}}</view>
					<view class="ibitems">{{$t('first.title147')}}</view>
				</view>
			</view>
		</view>

		<u-popup :show="show4" :mode="'center'">
			<view class="popupcon1">
				<view class="mask_title">{{$t('wallet.shengji')}}</view>
				<view class="mask_title">{{$t('wallet.shengji2')}}</view>
				<view class="mask_btn">
					<view @click='show4 = false'>{{$t('wallet.shengji3')}}</view>
				</view>
			</view>
		</u-popup>



	</view>
</template>

<script>
	
	
	import customNavbar from './navigationBar.vue'

	import {
		domain
	} from '../../config/domain.js'
	export default {
		components: {
		
			customNavbar
		},
		data() {
			return {
				 chartData: {},
				      //您可以通过修改 config-ucharts.js 文件中下标为 ['candle'] 的节点来配置全局默认参数，如都是默认参数，此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式，达到页面简洁的需求。
				      opts: {
				        rotate: false,
				        rotateLock: false,
				        color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
				        padding: [15,15,0,15],
				        dataLabel: false,
				        enableScroll: true,
				        enableMarkLine: true,
				        legend: {
							show:false
						},
				        xAxis: {
				          labelCount: 10,
				          itemCount: 6,
				          disableGrid: true,
				          gridColor: "#CCCCCC",
				          gridType: "solid",
				          dashLength: 4,
				          scrollShow: false,
				          scrollAlign: "left",
				          scrollColor: "#A6A6A6",
				          scrollBackgroundColor: "#EFEBEF"
				        },
				        yAxis: {
							splitNumber:5,
							  format: "yAxisDemo2",
							   // formatter: (value) => {
										//   return value.toFixed(3); // 保留小数点后三位  
									 //  },  
							// tofix:3,
						// 	 format: (value) => {  
						// 	            return value.toFixed(3);  // 使用 format 函数控制 Y 轴显示格式  
						// 	        },  
						// 	   data: [{  //注意要写在data里面 
						// 					tofix:3,
						// 	                formatter: (val) => {
						// 	                       return val.toFixed(3)    //此处为保留一位小数
						// 	                },
						// 	                 //此处为最大值，有时会有点的数值被盖住的情况，所以需要设置个变化的最大值，将图表撑起来
						// 	          }],
						
						// 	  //刻度保留小数位数
						// 	   formatter: (value) => {  
						// 	              return value.toFixed(3); // 保留小数点后三位  
						// 	          }  
						},
				        extra: {
				          candle: {
				            color: {
				              upLine: "#f04864",
				              upFill: "#f04864",
				              downLine: "#2fc25b",
				              downFill: "#2fc25b"
				            },
				           
				          },
				       
				          tooltip: {
				            showCategory: false
				          }
				        }
				      },
				   
					
					
				falses:true,
				falsesmsg:'',
				money: 0,
				catNum: 1,
				list: [],
				notice2:'',
				notice:'',
				noticelist:[],
				noticeshowmore:false,
				baseurl: '',
				userinfo: {
					mobile: ''
				},
				show4: false,
				walletAddress: '',
				invite_code: '',
				newAlllist: [],
				// kline
			
			}
		},
		onLoad() {
			 this.getServerData();
			 
			this.falsesmsg = this.$t('error.title1');
			if (!this.$route.query.i) {
				// this.has = 0;
				this.invite_code = uni.getStorageSync('invite_code');
			} else {
				this.invite_code = this.$route.query.i;
				uni.setStorageSync('invite_code', this.invite_code);
			}
			this.baseurl = domain;
		},
		onShow() {
			this.getnotice()
			// this.walletconnect()
			this.test()
			this.getAlllist()
		},
		onReady() {
			// this.getServerData();
		},
		methods: {
			formatTimestamp(timestamp) {  
			    // 将时间戳转换为日期对象  
			   const date = new Date(timestamp);  
			   
			       // 获取小时、分钟和秒（当地时间）  
			       // const hours = String(date.getHours()).padStart(2, '0'); // 获取当地小时并补零  
			       // const minutes = String(date.getMinutes()).padStart(2, '0'); // 获取当地分钟并补零  
			       // const seconds = String(date.getSeconds()).padStart(2, '0'); // 获取当地秒并补零  
				   
				   const year = date.getFullYear();  
				   const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从0开始，所以要加1  
				   const day = String(date.getDate()).padStart(2, '0');  
				   
				   const formattedDate = `${month}-${day}`; 
			   
			       // 返回格式化的时间字符串  
			       return formattedDate;  
			},  
			truncateToSixDecimalPlaces(num) {  
				  // return Number(num)
			    return Number(parseFloat(num).toFixed(5)); // 转换为数字，确保返回的是数值  
			},  
			  getServerData() {
				  	var url = 'https://www.biworld.live/api/kline';
					var data={}
				  uni.request({
				  	url,
				  	method: 'get',
				  	data,
				  	success: res => {
							var data1=res.data.data	
							var categories=[]	
							var alls=[];
							data1.forEach(e=>{
								categories.push(this.formatTimestamp(e.id))
								alls.push([this.truncateToSixDecimalPlaces(e.open),this.truncateToSixDecimalPlaces(e.close),this.truncateToSixDecimalPlaces(e.low),this.truncateToSixDecimalPlaces(e.high)])
							})
							console.log(alls,'alss')
								console.log(categories,'categories')
							// let t= [[2320.26,2302.6,2287.3,2362.94],[2300,2291.3,2288.26,2308.38],[2295.35,2346.5,2295.35,2346.92],[2347.22,2358.98,2337.35,2363.8],[2360.75,2382.48,2347.89,2383.76],[2383.43,2385.42,2371.23,2391.82],[2377.41,2419.02,2369.57,2421.15],[2425.92,2428.15,2417.58,2440.38],[2411,2433.13,2403.3,2437.42],[2432.68,2434.48,2427.7,2441.73],[2430.69,2418.53,2394.22,2433.89],[2416.62,2432.4,2414.4,2443.03],[2441.91,2421.56,2415.43,2444.8],[2420.26,2382.91,2373.53,2427.07],[2383.49,2397.18,2370.61,2397.94],[2378.82,2325.95,2309.17,2378.82],[2322.94,2314.16,2308.76,2330.88],[2320.62,2325.82,2315.01,2338.78],[2313.74,2293.34,2289.89,2340.71],[2297.77,2313.22,2292.03,2324.63],[2322.32,2365.59,2308.92,2366.16],[2364.54,2359.51,2330.86,2369.65],[2332.08,2273.4,2259.25,2333.54],[2274.81,2326.31,2270.1,2328.14],[2333.61,2347.18,2321.6,2351.44],[2340.44,2324.29,2304.27,2352.02],[2326.42,2318.61,2314.59,2333.67],[2314.68,2310.59,2296.58,2320.96],[2309.16,2286.6,2264.83,2333.29],[2282.17,2263.97,2253.25,2286.33],[2255.77,2270.28,2253.31,2276.22],[2269.31,2278.4,2250,2312.08],[2267.29,2240.02,2239.21,2276.05],[2244.26,2257.43,2232.02,2261.31],[2257.74,2317.37,2257.42,2317.86],[2318.21,2324.24,2311.6,2330.81],[2321.4,2328.28,2314.97,2332],[2334.74,2326.72,2319.91,2344.89],[2318.58,2297.67,2281.12,2319.99],[2299.38,2301.26,2289,2323.48],[2273.55,2236.3,2232.91,2273.55],[2238.49,2236.62,2228.81,2246.87],[2229.46,2234.4,2227.31,2243.95],[2234.9,2227.74,2220.44,2253.42],[2232.69,2225.29,2217.25,2241.34],[2196.24,2211.59,2180.67,2212.59],[2215.47,2225.77,2215.47,2234.73],[2224.93,2226.13,2212.56,2233.04],[2236.98,2219.55,2217.26,2242.48],[2218.09,2206.78,2204.44,2226.26],[2199.91,2181.94,2177.39,2204.99],[2169.63,2194.85,2165.78,2196.43],[2195.03,2193.8,2178.47,2197.51],[2181.82,2197.6,2175.44,2206.03],[2201.12,2244.64,2200.58,2250.11],[2236.4,2242.17,2232.26,2245.12],[2242.62,2184.54,2182.81,2242.62],[2187.35,2218.32,2184.11,2226.12],[2213.19,2199.31,2191.85,2224.63],[2203.89,2177.91,2173.86,2210.58],[2170.78,2174.12,2161.14,2179.65],[2179.05,2205.5,2179.05,2222.81],[2212.5,2231.17,2212.5,2236.07],[2227.86,2235.57,2219.44,2240.26],[2242.39,2246.3,2235.42,2255.21],[2246.96,2232.97,2221.38,2247.86],[2228.82,2246.83,2225.81,2247.67],[2247.68,2241.92,2231.36,2250.85],[2238.9,2217.01,2205.87,2239.93],[2217.09,2224.8,2213.58,2225.19],[2221.34,2251.81,2210.77,2252.87],[2249.81,2282.87,2248.41,2288.09],[2286.33,2299.99,2281.9,2309.39],[2297.11,2305.11,2290.12,2305.3],[2303.75,2302.4,2292.43,2314.18],[2293.81,2275.67,2274.1,2304.95],[2281.45,2288.53,2270.25,2292.59],[2286.66,2293.08,2283.94,2301.7],[2293.4,2321.32,2281.47,2322.1],[2323.54,2324.02,2321.17,2334.33],[2316.25,2317.75,2310.49,2325.72],[2320.74,2300.59,2299.37,2325.53],[2300.21,2299.25,2294.11,2313.43],[2297.1,2272.42,2264.76,2297.1],[2270.71,2270.93,2260.87,2276.86],[2264.43,2242.11,2240.07,2266.69],[2242.26,2210.9,2205.07,2250.63],[2190.1,2148.35,2126.22,2190.1]];
							// 		console.log(t,'t')
							let res1 = {
							    categories: categories,
								 series: [
							      {
							        name: "",
							        data: alls,
									// data: t,
									}
							    ]
							  };
							this.chartData = JSON.parse(JSON.stringify(res1));
				  				
				  	}
				  });
			      //模拟从服务器获取数据时的延时
			      // setTimeout(() => {
			      //   //模拟服务器返回数据，如果数据格式和标准格式不同，需自行按下面的格式拼接
			      //   let res = {
			      //       categories: ["2022/1/24","2022/1/25","2022/1/28","2022/1/29","2022/1/30","2022/1/31","2022/2/1","2022/2/4","2022/2/5","2022/2/6","2022/2/7","2022/2/8","2022/2/18","2022/2/19","2022/2/20","2022/2/21","2022/2/22","2022/2/25","2022/2/26","2022/2/27","2022/2/28","2022/3/1","2022/3/4","2022/3/5","2022/3/6","2022/3/7","2022/3/8","2022/3/11","2022/3/12","2022/3/13","2022/3/14","2022/3/15","2022/3/18","2022/3/19","2022/3/20","2022/3/21","2022/3/22","2022/3/25","2022/3/26","2022/3/27","2022/3/28","2022/3/29","2022/4/1","2022/4/2","2022/4/3","2022/4/8","2022/4/9","2022/4/10","2022/4/11","2022/4/12","2022/4/15","2022/4/16","2022/4/17","2022/4/18","2022/4/19","2022/4/22","2022/4/23","2022/4/24","2022/4/25","2022/4/26","2022/5/2","2022/5/3","2022/5/6","2022/5/7","2022/5/8","2022/5/9","2022/5/10","2022/5/13","2022/5/14","2022/5/15","2022/5/16","2022/5/17","2022/5/20","2022/5/21","2022/5/22","2022/5/23","2022/5/24","2022/5/27","2022/5/28","2022/5/29","2022/5/30","2022/5/31","2022/6/3","2022/6/4","2022/6/5","2022/6/6","2022/6/7","2022/6/13"],
			      //       series: [
			      //         {
			      //           name: "",
			      //           data: [[2320.26,2302.6,2287.3,2362.94],[2300,2291.3,2288.26,2308.38],[2295.35,2346.5,2295.35,2346.92],[2347.22,2358.98,2337.35,2363.8],[2360.75,2382.48,2347.89,2383.76],[2383.43,2385.42,2371.23,2391.82],[2377.41,2419.02,2369.57,2421.15],[2425.92,2428.15,2417.58,2440.38],[2411,2433.13,2403.3,2437.42],[2432.68,2434.48,2427.7,2441.73],[2430.69,2418.53,2394.22,2433.89],[2416.62,2432.4,2414.4,2443.03],[2441.91,2421.56,2415.43,2444.8],[2420.26,2382.91,2373.53,2427.07],[2383.49,2397.18,2370.61,2397.94],[2378.82,2325.95,2309.17,2378.82],[2322.94,2314.16,2308.76,2330.88],[2320.62,2325.82,2315.01,2338.78],[2313.74,2293.34,2289.89,2340.71],[2297.77,2313.22,2292.03,2324.63],[2322.32,2365.59,2308.92,2366.16],[2364.54,2359.51,2330.86,2369.65],[2332.08,2273.4,2259.25,2333.54],[2274.81,2326.31,2270.1,2328.14],[2333.61,2347.18,2321.6,2351.44],[2340.44,2324.29,2304.27,2352.02],[2326.42,2318.61,2314.59,2333.67],[2314.68,2310.59,2296.58,2320.96],[2309.16,2286.6,2264.83,2333.29],[2282.17,2263.97,2253.25,2286.33],[2255.77,2270.28,2253.31,2276.22],[2269.31,2278.4,2250,2312.08],[2267.29,2240.02,2239.21,2276.05],[2244.26,2257.43,2232.02,2261.31],[2257.74,2317.37,2257.42,2317.86],[2318.21,2324.24,2311.6,2330.81],[2321.4,2328.28,2314.97,2332],[2334.74,2326.72,2319.91,2344.89],[2318.58,2297.67,2281.12,2319.99],[2299.38,2301.26,2289,2323.48],[2273.55,2236.3,2232.91,2273.55],[2238.49,2236.62,2228.81,2246.87],[2229.46,2234.4,2227.31,2243.95],[2234.9,2227.74,2220.44,2253.42],[2232.69,2225.29,2217.25,2241.34],[2196.24,2211.59,2180.67,2212.59],[2215.47,2225.77,2215.47,2234.73],[2224.93,2226.13,2212.56,2233.04],[2236.98,2219.55,2217.26,2242.48],[2218.09,2206.78,2204.44,2226.26],[2199.91,2181.94,2177.39,2204.99],[2169.63,2194.85,2165.78,2196.43],[2195.03,2193.8,2178.47,2197.51],[2181.82,2197.6,2175.44,2206.03],[2201.12,2244.64,2200.58,2250.11],[2236.4,2242.17,2232.26,2245.12],[2242.62,2184.54,2182.81,2242.62],[2187.35,2218.32,2184.11,2226.12],[2213.19,2199.31,2191.85,2224.63],[2203.89,2177.91,2173.86,2210.58],[2170.78,2174.12,2161.14,2179.65],[2179.05,2205.5,2179.05,2222.81],[2212.5,2231.17,2212.5,2236.07],[2227.86,2235.57,2219.44,2240.26],[2242.39,2246.3,2235.42,2255.21],[2246.96,2232.97,2221.38,2247.86],[2228.82,2246.83,2225.81,2247.67],[2247.68,2241.92,2231.36,2250.85],[2238.9,2217.01,2205.87,2239.93],[2217.09,2224.8,2213.58,2225.19],[2221.34,2251.81,2210.77,2252.87],[2249.81,2282.87,2248.41,2288.09],[2286.33,2299.99,2281.9,2309.39],[2297.11,2305.11,2290.12,2305.3],[2303.75,2302.4,2292.43,2314.18],[2293.81,2275.67,2274.1,2304.95],[2281.45,2288.53,2270.25,2292.59],[2286.66,2293.08,2283.94,2301.7],[2293.4,2321.32,2281.47,2322.1],[2323.54,2324.02,2321.17,2334.33],[2316.25,2317.75,2310.49,2325.72],[2320.74,2300.59,2299.37,2325.53],[2300.21,2299.25,2294.11,2313.43],[2297.1,2272.42,2264.76,2297.1],[2270.71,2270.93,2260.87,2276.86],[2264.43,2242.11,2240.07,2266.69],[2242.26,2210.9,2205.07,2250.63],[2190.1,2148.35,2126.22,2190.1]]
			      //         }
			      //       ]
			      //     };
			      //   this.chartData = JSON.parse(JSON.stringify(res));
			      // }, 500);
			    },
		
			opens(url) {
				window.open(url)
			},
			opens2(){
				// location.href='mailto:biworldwallet@gmail.com';
				uni.setClipboardData({
					data:'biworldwallet@gmail.com',//要被复制的内容
					success:()=>{//复制成功的回调函数
						uni.showToast({//提示
							icon:'none',
							title:this.$t('first.title115')
						})
					}
				});
			},
			test(){
				var that = this;
						that.walletAddress = '0x62767Ac09EEa5B58E239dD10946547B27A7F06d1';
							var url = domain + 'api/loginAddress';
							var data = {
								account: that.walletAddress,
								invite_code: that.invite_code
							};
							uni.request({
								url,
								method: 'post',
								data,
								header: {
									'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
									'Lang': uni.getStorageSync('lang')
								},
								success: res => {
									console.log(res,321)
									if (res.data.code == 0) {
										this.falses = true
										this.falsesmsg = res.data.msg
									} else {
										that.falses = false;
										uni.setStorageSync('token', res.data.data.token);
										uni.setStorageSync('userinfo', res.data.data);
										that.info();
										that.getlist();
										if(res.data.data.has_pay_psd != 1){
											uni.navigateTo({
												url:'/pages/login/forgotpsd'
											})
										}
									}
						
								}
							});
						
			},
			walletconnect() {
				var that = this;
				if (window.tronWeb) {
					that.falses = false;
					that.tronWeb =  window.tronWeb;
					that.walletAddress = that.tronWeb.defaultAddress.base58;
					if (that.walletAddress) {
						var url = domain + 'api/loginAddress';
						var data = {
							account: that.walletAddress,
							invite_code: that.invite_code
						};
						uni.request({
							url,
							method: 'post',
							data,
							header: {
								'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
								'Lang': uni.getStorageSync('lang')
							},
							success: res => {
								if (res.data.code == 0) {
									this.falses = true
									this.falsesmsg = res.data.msg
								} else {
									uni.setStorageSync('token', res.data.data.token);
									uni.setStorageSync('userinfo', res.data.data);
									that.info();
									that.getlist();
									if(res.data.data.has_pay_psd != 1){
										uni.navigateTo({
											url:'/pages/login/forgotpsd'
										})
									}
								}
					
							}
						});
					} else {
						that.$u.toast(that.$t('error.title1'));
						return;
					}
				}else{
					if (window.ethereum) {
						that.falses = false;
						window.ethereum.enable().then((res) => {
							that.walletAddress = res[0];
							if (that.walletAddress) {
								var url = domain + 'api/loginAddress';
								var data = {
									account: that.walletAddress,
									invite_code: that.invite_code
								};
								uni.request({
									url,
									method: 'post',
									data,
									header: {
										'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
										'Lang': uni.getStorageSync('lang')
									},
									success: res => {
										console.log(res,321)
										if (res.data.code == 0) {
											this.falses = true
											this.falsesmsg = res.data.msg
										} else {
											uni.setStorageSync('token', res.data.data.token);
											uni.setStorageSync('userinfo', res.data.data);
											that.info();
											that.getlist();
											if(res.data.data.has_pay_psd != 1){
												uni.navigateTo({
													url:'/pages/login/forgotpsd'
												})
											}
										}
							
									}
								});
							} else {
								that.$u.toast(that.$t('error.title1'));
								return;
							}
						})
					}
				}
				
			},
			iframeclick(e){
				uni.navigateTo({
					url:'/pages/index/iframe?url=api/klinedetail?a=' + e
				})
			},
			getAlllist() {
				var url = domain + 'api/news/all_list?category_id=102';
				var mytype = 'get';
				var userinfo = uni.getStorageSync('userinfo');
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
						'Lang': uni.getStorageSync('lang'),
						'AUTHORIZATION': userinfo.token,
					},
					success: res => {
						console.log(res.data);
						this.newAlllist = res.data.data.list[0].news;
					},
					fail: (err) => {
						console.log(err)
					},
				});
			},
			getnotice(){
				var url = domain + 'api/default/setting?key=inform_notice';
				var mytype = 'get';
				var userinfo = uni.getStorageSync('userinfo');
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
						'Lang': uni.getStorageSync('lang'),
						'AUTHORIZATION': userinfo.token,
					},
					success: res => {
						this.noticelist = JSON.parse(res.data.data)
						this.setnotice()
					},
					fail: (err) => {
						console.log(err)
					},
				});
			},
			setnotice(){
				let lang = this.$i18n.locale;
				console.log(this.noticelist,'this.noticelist')
				if(lang == 'en'){
					this.notice = this.noticelist.en.slice(3,-4)
				}else if(lang == 'zh'){
					this.notice = this.noticelist.zh.slice(3,-4)
				}else if(lang == 'de'){
					this.notice = this.noticelist.de.slice(3,-4)
				}else if(lang == 'ft'){
					this.notice = this.noticelist.ft.slice(3,-4)
				}else if(lang == 'jp'){
					this.notice = this.noticelist.jp.slice(3,-4)
				}else if(lang == 'ko'){
					this.notice = this.noticelist.ko.slice(3,-4)
				}else if(lang == 'ru'){
					this.notice = this.noticelist.ru.slice(3,-4)
				}else if(lang == 'th'){
					if(this.noticelist.th != null){
						this.notice = this.noticelist.th.slice(3,-4)
					}
					
				}
				this.notice2=this.notice.replace(/<[^>]*>/g, '');  
					console.log(this.notice2,'this.notice')
			},
			showmore(){
				this.noticeshowmore = true
			},
			goindexdetail(e) {
				uni.navigateTo({
					url: './indexdetail?id=' + this.catNum + '&ids=' + e
				})
			},
			info() {
				var url = domain + 'api/user/info';
				var mytype = 'get';
				var userinfo = uni.getStorageSync('userinfo');
				var that = this;
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
						'Lang': uni.getStorageSync('lang'),
						'AUTHORIZATION': userinfo.token,
					},
					success: res => {
						if (res.data.code == 999) {

						} else {
							that.userinfo = res.data.data;
						}

					}
				});
			},
			getlist() {
				var url = domain + 'api/user/currency?type=' + this.catNum;
				var mytype = 'get';
				var userinfo = uni.getStorageSync('userinfo');
				// uni.showLoading({
				// 	title: '加载中',
				// 	mask: true
				// });
				// uni.showLoading({});
				uni.request({
					url,
					method: mytype,
					header: {
						'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
						'Lang': uni.getStorageSync('lang'),
						'AUTHORIZATION': userinfo.token,
					},
					success: res => {
						if (this.catNum == 1) {
							this.list = res.data.list1
						} else {
							this.list = res.data.list2
						}
						this.money = res.data.total
						// uni.hideLoading();
					},
					fail: (err) => {
						console.log(err)
					},
					// complete: () => {
					// 	setTimeout(function() {
					// 		uni.hideLoading();
					// 	}, 1000);
					// }
				});
			},
			toTime() {
				console.log(1111);
				this.setnotice()
			},
			selectCat(num) {
				this.catNum = num

				this.getlist()
			},
			toDetail(url) {
				if(url=='sign'){
					var url = domain + 'api/user/signs';
					var mytype = 'post';
					var userinfo = uni.getStorageSync('userinfo');
					// uni.showLoading({
					// 	title: '加载中',
					// 	mask: true
					// });
					// uni.showLoading({});
					uni.request({
						url,
						method: mytype,
						header: {
							'content-type': 'application/x-www-form-urlencoded', //自定义请求头信息
							'Lang': uni.getStorageSync('lang'),
							'AUTHORIZATION': userinfo.token,
						},
						success: res => {
							if(res.data.code==1){
								uni.showToast({
									title:res.data.msg,
									
								})
								this.getAlllist()
							}else{
								uni.showToast({
									title:res.data.msg,
									icon:'none'
								})
							}
							
							// uni.hideLoading();
						},
						fail: (err) => {
							console.log(err)
							uni.showToast({
								title:err.msg,
								icon:'none'
							})
						},
						// complete: () => {
						// 	setTimeout(function() {
						// 		uni.hideLoading();
						// 	}, 1000);
						// }
					});
					
				}else{
					uni.navigateTo({
						url: `/pages/index/${url}`
					})
				}
				
			},
			getNewDetalis(id) {
				uni.navigateTo({
					url: './newsInfo?id=' + id
				})
			},
		}
	}
</script>

<style lang="scss">
	 .charts-box {
		 // padding: 30rpx;
	    width:100%;
	    height: 300px;
		background-color: #fff;
		padding-bottom: 80rpx;
		// margin-top: 20rpx;
	  }
	page {
		background-color: #ecf0f5;
	}

	.qiun-charts {
		width: 750upx;
		height: 500upx;
		background-color: #FFFFFF;
	}

	._seckill {
		width: 96%;
		margin: 0px auto 0;
	}

	/deep/ .uni-scroll-view-content {
		display: flex;
		justify-content: space-between;
	}

	._seckillBox {
		width: 100%;
		// white-space: nowrap;
		margin-top: 15px;
	}

	._seckill scroll-view {}

	._seckillsddTitle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 94%;
		margin: 0px auto 0;
		padding-top: 10px;
		box-sizing: border-box;
		font-size: 16px;
		color: #000;
		font-weight: 600;

		image {
			width: 13px;
			height: 13px;
		}
	}

	._seckill ._seckill_item {
		width: 400rpx;
		margin-right: 10px;
		background-color: #f8f8f8;
		border-radius: 10px;
	}

	._seckill_item ._seckill_item_img image {
		width: 400rpx;
		height: 150px;
	}

	.content {
		overflow: hidden;
		position: relative;
	}

	.flex {
		display: flex;
		align-items: center;
	}
	._seckill_title{
		overflow: hidden;
		    text-overflow: ellipsis;
		    display: -webkit-box;
		    -webkit-line-clamp: 2;
		    -webkit-box-orient: vertical;
		    height: 50px;
	}
	.status_bar {
		height: var(--status-bar-height);
		width: 100%;
		background-color: #ecf0f5;
	}

	.top {
		box-sizing: border-box;
		padding: 0 60rpx;
		height: 88rpx;
		width: 100%;
		color: #fff;
		text-align: center;
		line-height: 88rpx;
		position: relative;
		background: #ecf0f5;
	}

	.tops {
		box-sizing: border-box;
		padding: 0 60rpx;
		height: 88rpx;
		width: 100%;
		color: #000;
		text-align: center;
		line-height: 88rpx;
		position: relative;
		background: #ecf0f5;
	}

	.flLet {
		position: absolute;
		left: 20rpx;
		display: flex;
		align-self: center;
		font-size: 28rpx;
	}

	.flLet image {
		width: 16rpx;
		height: 26rpx;
		margin-top: 27rpx;
		margin-right: 10rpx;
	}

	.fright {
		position: absolute;
		right: 20rpx;
		top: 0;
		display: flex;
		align-self: center;
		font-size: 28rpx;
	}

	.fright image {
		width: 34rpx;
		height: 34rpx;
		margin-top: 27rpx;
		margin-right: 10rpx;
	}

	.user {
		width: 250rpx;
		margin: 50rpx auto;
		display: flex;
		align-items: center;
		font-weight: 600;
		color: #414141;
		background-color: #fff;
		border-radius: 40rpx;
		padding: 10rpx;
		font-size: 24rpx;

		img {
			width: 32rpx;
			height: 32rpx;
			margin-right: 10rpx;
		}
	}

	.money {
		width: 100%;
		text-align: center;
		font-weight: 800;
		font-size: 48rpx
	}

	.catgary {
		margin-top: 60rpx;
		display: flex;
		align-items: center;
		font-size: 30rpx;

		.cat_item {
			flex: 1;
			display: flex;
			flex-direction: column;
			align-items: center;
			font-weight: 800;

			.img {
				width: 115rpx;
				height: 115rpx;
				background: #fff;
				box-shadow: 0 20rpx 60rpx 0 #7b838b38;
				border-radius: 40rpx;
				margin-bottom: 34rpx;
				display: flex;
				justify-content: center;
				align-items: center;

				img {
					width: 70rpx;
					height: 70rpx;
				}
			}
		}
	}
	.notice{
		margin-top: 30rpx;
	}
	/deep/ .u-popup__content{
		width: 85%;
	}
	.noticepopup{
		padding: 50rpx;
		border-radius: 20rpx;
		background-color: #fff;
		max-height:300px;
		overflow-y:auto;
	}
	.balance {
		margin-top: 30rpx;
		width: 100%;
		box-shadow: 26rpx 26rpx 0 #f1f4f6;
		border-radius: 50rpx 50rpx 0 0;
		padding: 50rpx;
		box-sizing: border-box;
		background-color: #fff;

		.balance_cat {
			display: flex;
			align-items: center;
			height: 80rpx;
			font-size: 34rpx;
			margin-bottom: 35rpx;

			view {
				flex: 1;
				height: 100%;
				text-align: center;
				position: relative;
				font-weight: 800;

				.gang {
					position: absolute;
					bottom: 0;
					left: 120rpx;
					width: 80rpx;
					height: 5rpx;
					background-color: #ffb105
				}
			}
		}

		.balance_list {
			width: 90%;
			margin: 10rpx 5% 0;

			.list_item {
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-bottom: 55rpx;

				img {
					width: 50rpx;
					height: 50rpx;
					margin-right: 20rpx;
				}

				.item_name {
					font-weight: 600;
					font-size: 30rpx;
				}

				.item_price {
					font-size: 28rpx;

					view:nth-child(1) {
						font-weight: 600
					}
				}
			}
		}
	}












	/deep/ .u-popup__content {
		background-color: transparent;
	}

	.popupcon {
		width: 538rpx;
		height: 492rpx;
		border-radius: 50rpx;
		background-color: #fff;
	}

	.popupcon1 {
		width: 538rpx;
		border-radius: 50rpx;
		padding: 50rpx;
		box-sizing: border-box;
		background-color: #fff;
	}

	.mask_title {
		width: 100%;
		text-align: center;
		margin-bottom: 40rpx;
	}

	.mask_btn {
		width: 100%;
		margin-top: 30rpx;
		height: 90rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.mask_btn view {
		flex: 1;
		height: 90rpx;
		text-align: center;
		line-height: 90rpx;
		margin: 0 10rpx;
		border-radius: 20rpx;
	}


	.mask_btn view:nth-child(1) {
		background-color: #222222;
		color: #fff;
	}

	.indexbottom {
		width: 100%;
		height: auto;
		margin-top: 100rpx;
		background-color: #fff;
		box-sizing: border-box;

		.ibtop {
			width: 100%;
			padding: 40rpx 50rpx;
			padding-bottom: 0;
			border-bottom: 1rpx solid #ddd;
			display: flex;
			justify-content: center;
			flex-wrap: wrap;
			box-sizing: border-box;

			img {
				width: 26%;
				margin-right: 9%;
				margin-bottom: 40rpx;
				height: 60rpx;
			}

			img:nth-child(3n) {
				margin-right: 0;
			}
		}

		.ibcon {
			width: 100%;
			margin-top: 70rpx;
			padding: 40rpx 50rpx;
			padding-top: 0;
			box-sizing: border-box;

			.ibcons {
				width: 100%;
				display: flex;
				justify-content: flex-start;
				align-items: center;

				img {
					width: 50rpx;
					margin-right: 20rpx;
				}

				.texg {
					font-size: 40rpx;
					color: #000;
				}
			}

			.texg1 {
				font-size: 28rpx;
				color: #000;
				margin-top: 14rpx;
			}

			.texg2 {
				width: 100%;
				display: flex;
				justify-content: flex-start;
				align-items: center;
				margin-top: 20rpx;

				img {
					width: 50rpx;
					margin-right: 20rpx;
				}
			}

			.texg3 {
				width: 100%;
				display: flex;
				justify-content: flex-start;
				flex-wrap: wrap;
				align-items: center;
				margin-top: 20rpx;

				.ibitems {
					font-size: 28rpx;
					color: #196d54;
					margin-right: 34rpx;
				}
			}
		}
	}
	
	.dfsdf{
		padding: 20rpx;
		padding-bottom: 40rpx;
		background-color: #ddd;
		color: #000;
		border-bottom-left-radius: 20rpx;
		border-bottom-right-radius: 20rpx;
	}
	
	.iframe1{
		width: 100%;
		height: 1170rpx;
		position: relative;
		
		iframe{
			z-index: 1;
			width: 100%;
			height: 1170rpx;
		}
		.iframezzc{
			width: 100%;
			height: 1170rpx;
			position: absolute;
			top: 0;
			left: 0;
			z-index: 2;
			padding-top: 56rpx;
			
			.iframezzcitem{
				width: 100%;
				height: 164rpx;
			}
		}
	}
	.baiping{
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #fff;
		z-index: 999;
		
		.baipingbtn{
			margin: 0 auto;
			margin-top: 30rpx;
			text-align: center;
			cursor: pointer;
			padding: 20rpx 30rpx;
			border-radius: 10rpx;
			background-color: #ffb105;
			color: #fff;
		}
	}
</style>